package service;

import service.mailer.AcceptUsuarioBuilder;
import service.mailer.FormularioDeRegistroBuilder;
import service.mailer.MailBuilder;
import service.mailer.MailDirector;
import valueObject.UsuarioRegistradoVO;

/**
 *
 * @author Juan Sebastian Hernández Serrato
 */
public class MailService {
    
    public void sendRegistroInformation(UsuarioRegistradoVO usuario){
        MailDirector md = new MailDirector();
        MailBuilder mb = new FormularioDeRegistroBuilder(usuario);
        md.setMailBuilder(mb);
        md.constructMail();
        try {
            md.getUPNMail().sendEmail();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
    public void sendAceptadoInfo(UsuarioRegistradoVO usuario){
        MailDirector md = new MailDirector();
        MailBuilder mb = new AcceptUsuarioBuilder(usuario);
        md.setMailBuilder(mb);
        md.constructMail();
        try {
            md.getUPNMail().sendEmail();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}